﻿using ShortLink.Common.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShortLink.Common.Exceptions
{
    public class BizException : Exception
    {
        public int Code { get; }
        public string Msg { get; }

        public BizException(int code, string message) : base(message)
        {
            Code = code;
            Msg = message;
        }

        public BizException(BizCodeEnum bizCodeEnum) : base(bizCodeEnum.GetMessage())
        {
            Code = bizCodeEnum.GetCode();
            Msg = bizCodeEnum.GetMessage();
        }
    }
}
